]> git.r.bdr.sh - rbdr/super-polarity/blame - Super Polarity/GameScreen.cs
Stuffffffff
[rbdr/super-polarity] / Super Polarity / GameScreen.cs
CommitLineData
74c15570
BB
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Microsoft.Xna.Framework;
6using Microsoft.Xna.Framework.Graphics;
7using Microsoft.Xna.Framework.Input;
8
9namespace SuperPolarity
10{
11 class GameScreen : Screen
12 {
13 public GameScreen(SuperPolarity newGame) : base(newGame) {}
14
097781e6
BB
15 private BasicGenerator generatorTest;
16
74c15570
BB
17 public override void Initialize()
18 {
19 InputController.RegisterEventForButton("changePolarity", Buttons.A);
20 InputController.RegisterEventForKey("changePolarity", Keys.Z);
21
22 InputController.RegisterEventForButton("shoot", Buttons.X);
23 InputController.RegisterEventForKey("shoot", Keys.X);
24 }
25
26 public override void LoadContent()
27 {
097781e6
BB
28
29 generatorTest = new BasicGenerator();
30 generatorTest.Initialize(Game, new Vector2(100, 600), BasicGenerator.Ships.Scout, 3000, 10);
31
74c15570
BB
32 Vector2 playerPosition = new Vector2(Game.GraphicsDevice.Viewport.TitleSafeArea.X, Game.GraphicsDevice.Viewport.TitleSafeArea.Y + Game.GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
33
097781e6
BB
34 ActorFactory.CreateMainShip(playerPosition);
35 ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200));
36 ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200));
37 ActorFactory.CreateScout(Ship.Polarity.Negative, new Vector2(500, 500));
38 ActorFactory.CreateCruiser(Ship.Polarity.Positive, new Vector2(40, 40));
74c15570
BB
39 }
40
41 public override void Update(GameTime gameTime)
42 {
43 InputController.UpdateInput();
44 ActorManager.Update(gameTime);
097781e6 45 generatorTest.Update(gameTime);
74c15570
BB
46 }
47
48 public override void Draw(SpriteBatch spriteBatch)
49 {
50 Renderer.Draw(spriteBatch);
51 }
52 }
53}